Skip to main content

git config --global -l

git config --global https.sslverify true git config --global user.email “you@example.com

设置

git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080'

清除保存好的账号密码 git config --system --unset credential.helper

你也可以设置长期记住密码: git config --global credential.helper store

修改仓库的地址带上你的账号密码

http://yourname:password@git.oschina.net/name/project.git //注意,码云平台同时支持个性地址与邮箱,当使用邮箱时,请对@符号使用%40替换 如果你原本使用的 ssh 地址想更换成 http(s) 地址,可以执行以下命令:

//删除原本的ssh仓库地址 git remote rm origin //origin 代表你原本ssh地址的仓库的别名 //新增http地址的仓库 git remote add origin http://git.oschina.net/username/project.git //设置http地址的仓库 git remote set-url origin git@gitlab.buddyniu.com:java/zhps_model.git

vim ~/.gitconfig

[http]
postBuffer = 524288000
proxy = socks5://127.0.0.1:1080
sslverify = true

[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[http]
postBuffer = 524288000
proxy = socks5://127.0.0.1:7890
sslBackend = openssl

[https]
sslverify = true
proxy = socks5://127.0.0.1:7890
[user]
name = arick
email = zyxlcr@qq.com
[core]
excludesfile = /Users/arick/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true